MAKEFILE_PATH = $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR = $(dir $(MAKEFILE_PATH))
SIMPLETCP_INSTALLDIR="/Users/alex/dev/LAG/cmake-build-debug/tfgen"


all: simpletcpclient simpletcpserver onlyrequesthttp

onlyrequesthttp:
	go build -o build/onlyrequest cli/onlyrequest/main.go

simpletcpserver:
	go build -o build/simpletcpserver cli/simpletcpserver/main.go


simpletcpclient:
	go build -o build/simpletcpclient cli/simpletcpclient/main.go


allsimpletcp_diffarch:
	GOOS=linux GOARCH=amd64 go build -o build/simpletcpserver cli/simpletcpserver/main.go && chmod u+x build/simpletcpserver
	GOOS=linux GOARCH=arm64 go build -o build/simpletcpclient cli/simpletcpclient/main.go && chmod u+x build/simpletcpclient


install_simpletcp:
	@echo "installing client"
	@cp build/simpletcpclient $(SIMPLETCP_INSTALLDIR)/simpletcpclient
	@echo "install server"
	rsync -p  -avz -e "ssh -p 22"  --progress --delete --exclude-from 'conf/exclude.txt' $(MAKEFILE_DIR)/build/ root@101.200.47.160:/root/simpletcp/
